import React, { useEffect,useState } from 'react';

type defaultProps = {
    placeholder?: string;
    value?: string; // 值
    disabled?: Boolean;
    onChange?: (v: string) => void; // 更新事件
  };
  const PassInput = (props: defaultProps) => {
      const [type,setType] = useState('text')
      useEffect(()=>{
        setTimeout(() => {
            setType('password')
        }, 100);
      },[])
    const {
      placeholder = '请输入',
      value = '',
      onChange = () => {},
      disabled = false,
    } = props;
    return (
      <div className="pass_input">  
          <input
            type={type}
            placeholder={placeholder}
            value={value}
            disabled={disabled ? true : false}
            onInput={(e) => {
              onChange(e.currentTarget.value);
            }}
          />
        
      </div>
    );
  };

export default PassInput;
